﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.Objects.DataClasses;
using System.ComponentModel;

namespace DTD2013.Entities
{
    public partial class DinhMuc
    {
        public global::System.String LoaiHaoPhi
        {
            get
            {
                return _LoaiHaoPhi;
            }
            set
            {
                OnLoaiHaoPhiChanging(value);
                ReportPropertyChanging("LoaiHaoPhi");
                _LoaiHaoPhi = StructuralObject.SetValidValue(value, false);
                ReportPropertyChanged("LoaiHaoPhi");
                OnLoaiHaoPhiChanged();
            }
        }
        private global::System.String _LoaiHaoPhi;
        partial void OnLoaiHaoPhiChanging(global::System.String value);
        partial void OnLoaiHaoPhiChanged();

        public global::System.String TenVatLieu
        {
            get
            {
                return _TenVatLieu;
            }
            set
            {
                OnTenVatLieuChanging(value);
                ReportPropertyChanging("TenVatLieu");
                _TenVatLieu = StructuralObject.SetValidValue(value, false);
                ReportPropertyChanged("TenVatLieu");
                OnTenVatLieuChanged();
            }
        }
        private global::System.String _TenVatLieu;
        partial void OnTenVatLieuChanging(global::System.String value);
        partial void OnTenVatLieuChanged();

        public global::System.String DonVi
        {
            get
            {
                return _DonVi;
            }
            set
            {
                OnDonViChanging(value);
                ReportPropertyChanging("DonVi");
                _DonVi = StructuralObject.SetValidValue(value, false);
                ReportPropertyChanged("DonVi");
                OnDonViChanged();
            }
        }
        private global::System.String _DonVi;
        partial void OnDonViChanging(global::System.String value);
        partial void OnDonViChanged();

        public double GiaThuc
        {
            get
            {
                return _GiaThuc;
            }
            set
            {
                OnGiaThucChanging(value);
                ReportPropertyChanging("GiaThuc");
                _GiaThuc = StructuralObject.SetValidValue(Math.Round(value, 0));
                ReportPropertyChanged("GiaThuc");
                OnGiaThucChanged();
            }
        }
        private double _GiaThuc;
        partial void OnGiaThucChanging(double value);
        partial void OnGiaThucChanged();

        public double GiaGoc
        {
            get
            {
                return _GiaGoc;
            }
            set
            {
                OnGiaGocChanging(value);
                ReportPropertyChanging("GiaGoc");
                _GiaGoc = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("GiaGoc");
                OnGiaGocChanged();
            }
        }
        private double _GiaGoc;
        partial void OnGiaGocChanging(Nullable<global::System.Double> value);
        partial void OnGiaGocChanged();

        public double ThanhTien
        {
            get
            {
                return _ThanhTien;
            }
            set
            {
                OnThanhTienChanging(value);
                ReportPropertyChanging("ThanhTien");
                _ThanhTien = StructuralObject.SetValidValue(Math.Round(value, 0));
                ReportPropertyChanged("ThanhTien");
                OnThanhTienChanged();
            }
        }
        private double _ThanhTien;
        partial void OnThanhTienChanging(double value);
        partial void OnThanhTienChanged();

        public double KhoiLuongCan
        {
            get
            {
                return _KhoiLuongCan;
            }
            set
            {
                OnKhoiLuongCanChanging(value);
                ReportPropertyChanging("KhoiLuongCan");
                _KhoiLuongCan = StructuralObject.SetValidValue(Math.Round(value, 4));
                ReportPropertyChanged("KhoiLuongCan");
                OnKhoiLuongCanChanged();
            }
        }
        private double _KhoiLuongCan;
        partial void OnKhoiLuongCanChanging(double value);
        partial void OnKhoiLuongCanChanged();

        public Nullable<global::System.Double> VanChuyenLenCao
        {
            get
            {
                return _VanChuyenLenCao;
            }
            set
            {
                OnVanChuyenLenCaoChanging(value);
                ReportPropertyChanging("VanChuyenLenCao");
                _VanChuyenLenCao = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("VanChuyenLenCao");
                OnVanChuyenLenCaoChanged();
            }
        }
        private Nullable<global::System.Double> _VanChuyenLenCao;
        partial void OnVanChuyenLenCaoChanging(Nullable<global::System.Double> value);
        partial void OnVanChuyenLenCaoChanged();

        #region Extra properties
        
        public bool IsVua
        {
            get
            {
                return _IsVua;
            }
            set
            {
                OnIsVuaChanging(value);
                ReportPropertyChanging("IsVua");
                _IsVua = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("IsVua");
                OnIsVuaChanged();
            }
        }
        private bool _IsVua;
        partial void OnIsVuaChanging(bool value);
        partial void OnIsVuaChanged();

        public string KLTT { get; set; }
        public double PhanTram { get; set; }
        public double DGSauThue { get; set; }

        public int ID { get; set; }
        public int ParentID { get; set; }
        public int? STT { get; set; }

        #endregion

        public DinhMuc()
        {
            _GiaThuc = 0;
            _GiaGoc = 0;
            _ThanhTien = 0;
            _KhoiLuongCan = 0;
            _VanChuyenLenCao = 0;
            _TenVatLieu = string.Empty;
        }
    }
}
